const express = require("express");
const app = express();
const port = 3000;
const cors = require("cors"); // 引入 cors 模块
// 使用 cors 中间件
app.use(cors());
app.use(express.json());
const usersRouter = require("./routes/users");
app.use("/users", usersRouter);

app.get("/", (req, res) => {
  res.send("Hello from Node.js server!");
});

app.listen(port, () => {
  console.log(`Server is running on http://localhost:${port}`);
});
